From: Jonas Dreßler Date: Wed, 16 Feb 2022 15:16:49 +0000 (+0100) Subject: st/scroll-view: Hide scroll bar from layout when its hidden X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~281^2~2^2~300 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=65e56183b117b69dfbb5ff012ad756ea32231846;p=gnome-shell.git st/scroll-view: Hide scroll bar from layout when its hidden We hide scrollbars with POLICY_AUTOMATIC when the content of the scroll view fits completely inside the view without having to scroll. In this case it seems like a good idea to give the content the full available size without subtracting scroll bars from that size. So subtract the scroll bar from the size we give to the child only when the scroll bar is actually visible, when it's invisible subtract 0 instead. Part-of: --- diff --git a/src/st/st-scroll-view.c b/src/st/st-scroll-view.c index f278568dc..3313307de 100644 --- a/src/st/st-scroll-view.c +++ b/src/st/st-scroll-view.c @@ -636,19 +636,14 @@ st_scroll_view_allocate (ClutterActor *actor, clutter_actor_allocate (priv->hscroll, &empty_box); } - /* In case the scrollbar policy is NEVER or EXTERNAL or scrollbars - * should be overlaid, we don't trim the content box allocation by - * the scrollbar size. + /* In case the scrollbar is hidden or scrollbars should be overlaid, + * we don't trim the content box allocation by the scrollbar size. * Fold this into the scrollbar sizes to simplify the rest of the * computations. */ - if (priv->hscrollbar_policy == ST_POLICY_NEVER || - priv->hscrollbar_policy == ST_POLICY_EXTERNAL || - priv->overlay_scrollbars) + if (!hscrollbar_visible || priv->overlay_scrollbars) sb_height = 0; - if (priv->vscrollbar_policy == ST_POLICY_NEVER || - priv->vscrollbar_policy == ST_POLICY_EXTERNAL || - priv->overlay_scrollbars) + if (!vscrollbar_visible || priv->overlay_scrollbars) sb_width = 0; /* Child */